// .txt

beginzonescript;

variables;

short crime_tolerance = 5;
short last_abil;
short i;

body;

beginstate INIT_STATE;

	set_name(13,"Lacey");
	set_level(13,20);
	
	set_name(14,"Arango");

	add_range_to_group(15,22,1);
	set_aggression(1001,7);
	set_name(20,"Feral Roamer");
	set_name(21,"Feral Roamer");
	set_name(22,"Feral Roamer");

	set_name(23,"Rogue Hunter");
	set_name(24,"Rogue Hunter");
	
	set_name(27,"Wounded Clawbug");
	set_name(28,"Wounded Roamer");
	set_name(29,"Servile Vet");
	set_name(30,"Servile Vet");
	set_level(29,25);
	set_level(30,25);

	add_range_to_group(54,58,2);
	set_name(1002,"Guard Roamer");
	set_level(1002,20);
	set_boss_level(1002,1);
	
	if (get_sdf(22,1) > 0) {
		make_zone_hostile();
		}
		else {
			print_str_color("This is a friendly settlement. You are able to rest.",2);
			revive_party();
			}

	last_abil = get_current_tick();
	
	set_crime_tolerance(crime_tolerance);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	// clear zone?
	//if ((zone_clear(ME) == FALSE) && (get_flag(,) > 0)) {
		//print_str_color("",2);
		//clear_zone(ME);	
		//}
		
	if ((get_crime_level() >= crime_tolerance) && (get_sdf(22,1) == 0)) {
		make_zone_hostile();
		set_flag(22,1,1);
		}

	 if (gf(22,1) == 0) {
	 	if (gf(12,2) == 0) {
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(8,"I can't talk to you yet.");
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(8,"You need to find Astoria.");
	 		}
	 	if (gf(12,2) > 0) {
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(8,"We will live with Shapers.");
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(8,"You are welcome.");
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(8,"Bryn is wrong.");
	 		}
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(13,"The Shadow Road is hard.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(13,"Stay out of it.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(13,"Is danger!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(14,"We're closing soon.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(14,"Still need something?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(14,"Anything else?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23 + get_ran(1,0,3),"Almost took my head off!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23 + get_ran(1,0,3),"Then it grabbed my leg!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23 + get_ran(1,0,3),"Pass the ale.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23 + get_ran(1,0,3),"I bet five.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23 + get_ran(1,0,3),"Roll the dice!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23 + get_ran(1,0,3),"A new visitor!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23 + get_ran(1,0,3),"Six. You lose!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23 + get_ran(1,0,3),"Biggest one I ever saw!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23 + get_ran(1,0,3),"I hate the Unbound.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(39 + get_ran(1,0,3),"Must dig.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(39 + get_ran(1,0,3),"Bad weeds.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(39 + get_ran(1,0,3),"Ummm ... Me no talk.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(43,"Zzzzz.");
		}
	
	//if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_group()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
	//	last_abil = get_current_tick();
	//	}
break;

beginstate 10;
	sf(22,4,1);
	sf(22,7,1);
	sf(22,8,1);
	erase_char(9);
break;

//	print_str("");
//	set_terrain_string_range(".",3);
//	set_terrain_string_range("The sign says - .",3);
